home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / t_os / tool / fxcdl / src / tsmacro.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  800 b   |  27 lines

  1. /*********************************************************************
  2. *    T.Shimomura's Macro Collection という程のこともない(^_^;)
  3. *********************************************************************/
  4.  
  5. #ifndef TSMACRO_H
  6. #define TSMACRO_H
  7.  
  8. /* 配列の要素数を求めるELEMENTS_OFマクロ */
  9. #define ELEMENTS_OF(array)    (sizeof(array)/sizeof((array)[0]))
  10.  
  11. /* デバッグ用PRINTFマクロ */
  12. /* DEBUGが定義されていると、出力を行う */
  13. #if defined(DEBUG)
  14. #    define PRINTF(p)    (printf p)
  15. #else
  16. #    define PRINTF(p)    ((void) 0)
  17. #endif
  18.  
  19. #define    iskanji(c)    \
  20.     ((0x81 <= (c) && (c) <= 0x9F) || (0xE0 <= (c) && (c) <= 0xFC))
  21. #define    iskanji2(c)    \
  22.     ((0x40 <= (c) && (c) <= 0x7E) || (0x80 <= (c) && (c) <= 0xFC))
  23. #define    isprkana(c)    \
  24.     (((c) < 0x80 && isprint(c)) || ((c) >= 0xA1 && (c) <= 0xDF))
  25.  
  26. #endif
  27.